#ifndef _KZLIB_DAC81416_
#define _KZLIB_DAC81416_

#include "../common_typedef.h"

struct Dac81416GpioPack {
    uint32_t cs = 0xffffffff;
    uint32_t load = 0xffffffff;
    uint32_t clr = 0xffffffff;
};

class DrvDac81416 {
public:
    DrvDac81416(const char* designator, uint32_t dataBus, Dac81416GpioPack io) : 
        m_dataBus(dataBus), m_io(io),
        m_designator(designator)
    {

    }
    void Init();
    void SetDacDataBuffer(uint32_t ch, uint16_t dacData);
    void LoadVoltage();
    const char* ChipName() { return m_designator; }

private:
    uint32_t m_dataBus = 0xffffffff;
    Dac81416GpioPack m_io;
    const char* m_designator = "DAC?";
};

#endif